Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop num_actions from DiscreteDP #207

Merged
merged 3 commits into from
Jun 23, 2018
Merged

Conversation

a-parida12
Copy link
Contributor

solves #103

@codecov-io
Copy link

codecov-io commented Apr 29, 2018

Codecov Report

Merging #207 into master will increase coverage by 0.17%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #207      +/-   ##
==========================================
+ Coverage   90.59%   90.76%   +0.17%     
==========================================
  Files          24       25       +1     
  Lines        1723     1744      +21     
==========================================
+ Hits         1561     1583      +22     
+ Misses        162      161       -1
Impacted Files Coverage Δ
src/markov/ddp.jl 95.93% <100%> (+0.48%) ⬆️
src/filter.jl 100% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update be0a32e...fc256e1. Read the comment docs.

@sglyon
Copy link
Member

sglyon commented Apr 30, 2018

Thanks for taking this on!

I think my preference would be to just delete the function, but maintain the naming of variables inside our other functions (e.g. still use num_states, num_actions instead of m, n).

I'd like to get some other opinions on that though... cc @oyamad @cc7768 @mmcky @jstac

@cc7768
Copy link
Member

cc7768 commented Apr 30, 2018

Thanks for working to close this issue @a-parida12

I agree with @sglyon -- I like the explicitness of num_states and num_actions. Well named variables can often serve as a way of documenting code.

@a-parida12
Copy link
Contributor Author

@sglyon I don't fully understand which particular function to be dropped then.

@sglyon
Copy link
Member

sglyon commented May 1, 2018

Sorry for not being clear on this one.

You did delete the proper function, but in a few instances you also changed the name of some variables (in the DiscreteDP constructor as well as a few docstrings) away from num_actions to the single letter n.

We should keep the descriptive variable names, but still delete the function as you did. I think that we want to end up with a 1-line change relative to the current master branch that just removes the function definition. We should also check src/QuantEcon.jl to make sure num_actions is not being exported and the test files to make sure it is not called in the tests..

Copy link
Member

@sglyon sglyon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @a-parida12 for making the change. There were a couple minor formatting issues in the docstrings that we should address.

After that we can merge!

@@ -577,7 +577,7 @@ end

"""
Return the `Vector` `max_a vals(s, a)`, where `vals` is represented as a
`AbstractMatrix` of size `(num_states, num_actions)`.
`AbstractMatrix` of size `(num_states, num_actions).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think here we need a closing backtick character after `num_actions)

@@ -589,7 +589,7 @@ s_wise_max!(vals::AbstractMatrix, out::AbstractVector) = (println("calling this

"""
Populate `out` with `max_a vals(s, a)`, where `vals` is represented as a
`AbstractMatrix` of size `(num_states, num_actions)`.
`AbstractMatrix` of size `(num_states, num_actions).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment about backtick here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, my bad. I will improve the formatting.

@sglyon sglyon merged commit 785c71b into QuantEcon:master Jun 23, 2018
@sglyon
Copy link
Member

sglyon commented Jun 23, 2018

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants